<template>
  <div class="sohu-wrap">
    <h1>sohu ....</h1>
    <div>
      <span>age:</span>
      <Input v-model="age" icon="ios-clock-outline" placeholder="请输入..." style="width: 200px"></Input>
    </div>
    <div>
      <Menu active-name="新闻导航//aa//ss" :open-names="['用户管理']" ref="aa">
        <Submenu :name="val.name" v-for="(val,key,index) in tree" :key='index'>
          <template slot="title">
            <Icon type="ios-paper"></Icon>
            {{val.name}}
          </template>
          <Menu-item :name="val2.name" v-for="(val2,key2,index2) in val.subName" :key="index2">{{val2.name}}</Menu-item>
          <Menu-item name="3-3">时段分析</Menu-item>
        </Submenu>
        
      </Menu>
    </div>
  </div>
</template>
<style lang="less" scoped>

</style>
<script>
export default {
  data(){
    return {
      age:12,
      tree:[
        {
          name:'用户管理',
          subName:[
            {
              name:"用户1"
            },
            {
              name:"新闻导航//aa//ss"
            },
            {
              name:"用户3"
            },{
              name:"用户4"
            }
          ]
        },
        {
          name:'统计分析',
          subName:[
            {
              name:"统计1"
            },
            {
              name:"统计2"
            },
            {
              name:"用统计户3"
            },{
              name:"统计用户4"
            }
          ]
        }
      ]
    }
  },
  created(){
    var that=this;
    this.$nextTick(()=>{
        this.$refs.aa.updateActiveName();
        console.log(that.$refs.aa,999999999)
    })
  }
}
</script>


